package com.softaria.spkiller.layers;

public class LayerIdentifierImpl implements LayerIdentifier {

	private String layerName;
	
	public LayerIdentifierImpl(String layerName) {
		super();
		this.layerName = layerName;
	}

	@Override
	public String getName() {
		return layerName;
	}

	@Override
	public int hashCode() {
		if(layerName == null) {
			return super.hashCode();
		}
		else {
			return layerName.hashCode();
		}
	}

	@Override
	public boolean equals(Object obj) {
		if(layerName==null) {
			return false;
		}
		else {
			if(obj instanceof LayerIdentifier) {
				LayerIdentifier other  = (LayerIdentifier)obj;
				return layerName.equals(other.getName());
			}
			else {
				return false;
			}
		}
	}

	@Override
	public String toString() {
		return "["+layerName+"]";
	}
	
	

}
